using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace CinemaLib
{
    /// <summary>
    /// Contains Row Properties via WCF.
    /// </summary>
    [DataContract]
    public class Row
    {
        [DataMember]
        public int Number { get; private set; }

        [DataMember]
        public List <Seat> Seats { get; private set; }

        /// <summary>
        /// Index.
        /// </summary>
        /// <param name="i">Select Index of Seat.</param>
        /// <returns>Returns seat of an Index.</returns>
        public Seat this [int i]
        {
            get { return Seats[i]; }
            set { Seats[i] = value; }
        }

        public Row(int _number)
        {
            Number = _number;
            Seats = new List<Seat>();
        }

        public Row(int _number, List<Seat> _seats)
        {
            Number = _number;
            Seats = _seats;
        }
    }
}
